package com.txtsqlclient.ws;

import java.util.ArrayList;
import java.util.List;

/**
 * This is an exception to specify any problems occurring while creating,
 * closing or managing the connections.
 * 
 * @author spadda
 */
@SuppressWarnings("serial")
public class ValidationException extends Exception {

	private List<String> validationErrors = new ArrayList<String>();

	public ValidationException() {
		super();
	}

	public ValidationException(final String message) {
		super(message);
	}

	public ValidationException(final Throwable cause) {
		super(cause);
	}

	public ValidationException(final String message, final Throwable cause) {
		super(message, cause);
	}

	public void addValidationError(String error) {
		this.validationErrors.add(error);
	}

	public List<String> getValidationErrors() {
		return this.validationErrors;
	}

	public void addValidationErrors(List<String> errors) {
		this.validationErrors.addAll(errors);
	}
}